home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12071 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: news.mindspring.com!usenet
  2. From: rudd@mindspring.com (Justin Rudd)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: CFile read problem.....
  5. Date: Mon, 18 Mar 1996 04:17:16 GMT
  6. Organization: MindSpring Enterprises
  7. Message-ID: <4iio6j$itl@B1FF.mindspring.com>
  8. References: <4ii1ck$bve@newsbf02.news.aol.com>
  9. Reply-To: rudd@mindspring.com
  10. NNTP-Posting-Host: rudd.mindspring.com
  11. X-Newsreader: Forte Free Agent v0.55
  12.  
  13. >note:  buffer2 is a string that contains the path where the config.dat
  14. >file is located.
  15. >We do not know the proper syntax required to use the buffer2 and
  16. >config.dat file
  17. >together. The code listed above does not work for this reason. We've tried
  18. >many things
  19. >without any luck. If we use this code: CFile
  20. >readMe("C:\\Prog\\config.dat",
  21. >CFile::modeRead ); it works fine....However,  we need to use it with the
  22. >buffer2 string
  23. >which contains the path to the directory. We know that buffer2 string
  24. >holds the path since
  25. >we used "trace" to verify it.
  26.  
  27. >Does anyone know how to accomplish this?
  28.  
  29. Couldn't you do this:
  30.  
  31.     char temp[MAX_PATH];
  32.     strccpy( temp, buffer2 );
  33.     strcat( temp, "\\config.dat" );
  34.     CFile readMe( temp, CFile::modeRead );
  35.     
  36. Then just pass temp to the CFile ctor.  I've used this "trick" ( if
  37. you can call it that ) many times.
  38.  
  39. Justin
  40.  
  41.